'use strict';

const Controller = require('egg').Controller;

class CollectController extends Controller {
  async index() {
    const { ctx } = this;
    var {id,collected} = ctx.request.body
    var data = await ctx.model.Top250.updateOne({_id:id},{$set:{collected}})
    if(data.nModified == 1){
        ctx.body = {
            code:200,
            msg:"收藏成功"
        }
    }
  }
}

module.exports = CollectController;